cmake_minimum_required(VERSION 3.16)

set(CMAKE_CXX_COMPILER clang++)
set(CMAKE_C_COMPILER clang)

project(helloworld)

set(EXECUTABLE_NAME helloworld)

set(
    SOURCES
    helloworld.m
)

add_executable(
    ${EXECUTABLE_NAME}
    ${SOURCES}
)

target_include_directories(
    ${EXECUTABLE_NAME}
    PUBLIC
    /usr/include/GNUstep
)

target_link_directories(
    ${EXECUTABLE_NAME}
    PUBLIC
    /usr/lib
)

target_link_libraries(
    ${EXECUTABLE_NAME}
    PUBLIC
    gnustep-base
    objc
)

target_compile_definitions(
    ${EXECUTABLE_NAME}
    PUBLIC
    _NATIVE_OBJC_EXCEPTIONS
)

target_compile_options(
    ${EXECUTABLE_NAME}
    PUBLIC
    -fconstant-string-class=NSConstantString
)